import React from "react";
import MayLayout from "@/components/layout/MayLayout";
import AuthRoute from "./AuthRoute";

import {
  BrowserRouter,
  Route,
  Redirect,
  Switch,
  withRouter,
} from "react-router-dom";
import Login from "@/pages/Login";
import Home from "@/pages/Home";
import Goodsmanage from "@/pages/Goodsmanage";
import Member from "@/pages/Member";
import Banner from "@/components/Banner";
import Redux from "@/pages/redux";
import Erro404 from "@/pages/Erro404";

function OldRoute(props) {
  console.log(props);
  return (
    <BrowserRouter>
      <Switch>
        <Route path="/login" component={Login} />
        <AuthRoute path="/erro404" component={Erro404} />
        <MayLayout>
          <Switch>
            <AuthRoute isAuth exact path="/" component={Home} />
            <AuthRoute isAuth path="/goodsmanage" component={Goodsmanage} />
            <AuthRoute isAuth path="/member" component={Member} />
            <AuthRoute isAuth path="/banner" component={Banner} />
            <AuthRoute isAuth path="/redux" component={Redux} />
            <Redirect to="/erro404" />
          </Switch>
        </MayLayout>
      </Switch>
    </BrowserRouter>
  );
}

export default OldRoute;
